<?php

use Webman\Route;
use plugin\ky_shouyin\app\controller\admin\MemberController;


// 前台路由
Route::group('/app/ky_shouyin/front', function () {
    // 临时跳转页面
    Route::get('/temporary', function () {
        return view('front/temporary');
    });

    // 收银台
    Route::get('/cashier/index', [plugin\ky_shouyin\app\controller\front\CashierController::class, 'index']);
    Route::get('/cashier/goods', [plugin\ky_shouyin\app\controller\front\CashierController::class, 'goods']);
    Route::get('/cashier/categories', [plugin\ky_shouyin\app\controller\front\CashierController::class, 'categories']);
    Route::get('/cashier/getMember', [plugin\ky_shouyin\app\controller\front\CashierController::class, 'getMember']);
    Route::post('/cashier/submit-order', [plugin\ky_shouyin\app\controller\front\CashierController::class, 'submitOrder']);
    Route::post('/cashier/sendVerifyCode', [plugin\ky_shouyin\app\controller\front\CashierController::class, 'sendVerifyCode']);

    // 会员开卡
    Route::get('/member/index', [plugin\ky_shouyin\app\controller\front\MemberController::class, 'index']);
    Route::get('/member/add', [plugin\ky_shouyin\app\controller\front\MemberController::class, 'add']);
    Route::get('/member/getLevels', [plugin\ky_shouyin\app\controller\front\MemberController::class, 'getLevels']);
    Route::get('/member/getStores', [plugin\ky_shouyin\app\controller\front\MemberController::class, 'getStores']);
    Route::post('/member/register', [plugin\ky_shouyin\app\controller\front\MemberController::class, 'register']);

    //订单管理
    Route::get('/order/list', [plugin\ky_shouyin\app\controller\front\OrderController::class, 'list']);
    Route::get('/order/get-list', [plugin\ky_shouyin\app\controller\front\OrderController::class, 'getList']);
    Route::post('/order/refund', [plugin\ky_shouyin\app\controller\front\OrderController::class, 'refund']);
    Route::get('/order/detail', [plugin\ky_shouyin\app\controller\front\OrderController::class, 'detail']);


    //会员充值
    Route::get('/member/recharge', [plugin\ky_shouyin\app\controller\front\MemberController::class, 'recharge']);
    Route::post('/member/doRecharge', [plugin\ky_shouyin\app\controller\front\MemberController::class, 'doRecharge']);
    Route::get('/member/rechargeList', [plugin\ky_shouyin\app\controller\front\MemberController::class, 'rechargeList']);
    Route::get('/member/getMember', [plugin\ky_shouyin\app\controller\front\MemberController::class, 'getMember']);
});

// 后台路由
Route::group('/app/ky_shouyin/admin', function () {
    //用户登录
    Route::get('/account/userlogin', [plugin\ky_shouyin\app\controller\admin\AccountController::class, 'userlogin']);
    Route::get('/account/logout', [plugin\ky_shouyin\app\controller\admin\AccountController::class, 'logout']);
    Route::get('/account/captcha/{type}', [plugin\ky_shouyin\app\controller\admin\AccountController::class, 'captcha']);
    Route::post('/account/login', [plugin\ky_shouyin\app\controller\admin\AccountController::class, 'login']);

    // 后台首页
    Route::get('/', [plugin\ky_shouyin\app\controller\admin\IndexController::class, 'index']);
    Route::get('/index', [plugin\ky_shouyin\app\controller\admin\IndexController::class, 'index']);

    // 订单管理
    Route::get('/order/index', [plugin\ky_shouyin\app\controller\admin\OrderController::class, 'index']);
    Route::get('/order/list', [plugin\ky_shouyin\app\controller\admin\OrderController::class, 'list']);
    Route::get('/order/detail', [plugin\ky_shouyin\app\controller\admin\OrderController::class, 'detail']);
    Route::get('/order/export', [plugin\ky_shouyin\app\controller\admin\OrderController::class, 'export']);
    Route::get('/order/rechargelist', [plugin\ky_shouyin\app\controller\admin\OrderController::class, 'rechargeList']);
    Route::get('/order/rechargeList', [plugin\ky_shouyin\app\controller\admin\OrderController::class, 'rechargeList']);
    Route::post('/order/refund', [plugin\ky_shouyin\app\controller\admin\OrderController::class, 'refund']);
    Route::post('/order/detail', [plugin\ky_shouyin\app\controller\admin\OrderController::class, 'detail']);

    // 会员管理
    Route::get('/member/index', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'index']);
    Route::get('/member/list', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'list']);
    Route::get('/member/add', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'add']);
    Route::post('/member/add', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'add']);
    Route::get('/member/edit', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'edit']);
    Route::post('/member/edit', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'edit']);
    Route::post('/member/delete', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'delete']);
    Route::get('/member/getLevels', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'getLevels']);
    Route::get('/member/detail', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'detail']);
    Route::get('/member/selectCard', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'selectCard']);
    Route::post('/member/selectCard', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'selectCard']);
    Route::get('/member/getUnusedCards', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'getUnusedCards']);
    Route::get('/member/recharge', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'recharge']);
    Route::post('/member/recharge', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'recharge']);
    Route::post('/member/modifyRecharge', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'modifyRecharge']);
    Route::get('/member/rechargeLog', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'rechargeLog']);

    // 会员卡管理
    Route::get('/member/card', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'card']);
    Route::get('/member/cardList', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'cardList']);
    Route::post('/member/generateCards', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'generateCards']);
    Route::post('/member/voidCard', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'voidCard']);
    Route::post('/member/batchVoidCards', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'batchVoidCards']);
    Route::get('/member/exportCards', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'exportCards']);

    // 会员等级管理
    Route::get('/member/level', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'level']);
    Route::get('/member/levelList', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'levelList']);
    Route::get('/member/levelAdd', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'levelAdd']);
    Route::post('/member/levelAdd', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'levelAdd']);
    Route::get('/member/levelEdit', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'levelEdit']);
    Route::post('/member/levelEdit', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'levelEdit']);
    Route::post('/member/levelDelete', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'levelDelete']);

    // 积分规则管理
    Route::get('/member/points', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'points']);
    Route::get('/member/pointsList', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'pointsList']);
    Route::get('/member/pointsRule', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'pointsRule']);
    Route::get('/member/pointsRuleList', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'pointsRuleList']);
    Route::get('/member/pointsRuleAdd', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'pointsRuleAdd']);
    Route::post('/member/pointsRuleAdd', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'pointsRuleAdd']);
    Route::get('/member/pointsRuleEdit', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'pointsRuleEdit']);
    Route::post('/member/pointsRuleEdit', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'pointsRuleEdit']);
    Route::post('/member/pointsRuleDelete', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'pointsRuleDelete']);
    Route::get('/member/pointsRuleDetail', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'pointsRuleDetail']);
    Route::post('/member/checkIn', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'checkIn']);
    Route::post('/member/adjustPoints', [plugin\ky_shouyin\app\controller\admin\MemberController::class, 'adjustPoints']);

    // 门店管理
    Route::get('/store/index', [plugin\ky_shouyin\app\controller\admin\StoreController::class, 'index']); 
    Route::get('/store/list', [plugin\ky_shouyin\app\controller\admin\StoreController::class, 'list']); 
    Route::get('/store/add', [plugin\ky_shouyin\app\controller\admin\StoreController::class, 'add']); 
    Route::post('/store/add', [plugin\ky_shouyin\app\controller\admin\StoreController::class, 'add']); 
    Route::get('/store/edit', [plugin\ky_shouyin\app\controller\admin\StoreController::class, 'edit']); 
    Route::post('/store/edit', [plugin\ky_shouyin\app\controller\admin\StoreController::class, 'edit']); 
    Route::post('/store/delete', [plugin\ky_shouyin\app\controller\admin\StoreController::class, 'delete']); 
    Route::get('/store/getList', [plugin\ky_shouyin\app\controller\admin\StoreController::class, 'getList']);

    // 员工管理
    Route::get('/staff/index', [plugin\ky_shouyin\app\controller\admin\StaffController::class, 'index']);
    Route::get('/staff/list', [plugin\ky_shouyin\app\controller\admin\StaffController::class, 'list']);
    Route::get('/staff/add', [plugin\ky_shouyin\app\controller\admin\StaffController::class, 'add']);
    Route::post('/staff/add', [plugin\ky_shouyin\app\controller\admin\StaffController::class, 'add']);
    Route::get('/staff/edit', [plugin\ky_shouyin\app\controller\admin\StaffController::class, 'edit']);
    Route::post('/staff/edit', [plugin\ky_shouyin\app\controller\admin\StaffController::class, 'edit']);
    Route::post('/staff/delete', [plugin\ky_shouyin\app\controller\admin\StaffController::class, 'delete']);
    Route::get('/staff/getList', [plugin\ky_shouyin\app\controller\admin\StaffController::class, 'getList']);

    // 交班管理
    Route::get('/staff/shift', [plugin\ky_shouyin\app\controller\admin\StaffController::class, 'shift']);
    Route::get('/staff/currentShift', [plugin\ky_shouyin\app\controller\admin\StaffController::class, 'currentShift']);
    Route::get('/staff/shiftList', [plugin\ky_shouyin\app\controller\admin\StaffController::class, 'shiftList']);
    Route::post('/staff/endShift', [plugin\ky_shouyin\app\controller\admin\StaffController::class, 'endShift']);
    Route::get('/staff/shiftDetail', [plugin\ky_shouyin\app\controller\admin\StaffController::class, 'shiftDetail']);
    Route::post('/staff/deleteShift', [plugin\ky_shouyin\app\controller\admin\StaffController::class, 'deleteShift']);

    // 统计分析
    Route::get('/statistics/index', [plugin\ky_shouyin\app\controller\admin\StatisticsController::class, 'index']);
    Route::get('/statistics/sales', [plugin\ky_shouyin\app\controller\admin\StatisticsController::class, 'sales']);
    Route::get('/statistics/member', [plugin\ky_shouyin\app\controller\admin\StatisticsController::class, 'member']);
    Route::get('/statistics/payment', [plugin\ky_shouyin\app\controller\admin\StatisticsController::class, 'payment']);

    // 商品管理
    Route::get('/goods/index', [plugin\ky_shouyin\app\controller\admin\GoodsController::class, 'index']); // 商品列表
    Route::get('/goods/list', [plugin\ky_shouyin\app\controller\admin\GoodsController::class, 'list']); // 商品列表
    Route::get('/goods/add', [plugin\ky_shouyin\app\controller\admin\GoodsController::class, 'add']); // 添加商品页面
    Route::post('/goods/add', [plugin\ky_shouyin\app\controller\admin\GoodsController::class, 'add']); // 添加商品
    Route::get('/goods/edit', [plugin\ky_shouyin\app\controller\admin\GoodsController::class, 'edit']); // 编辑商品页面
    Route::post('/goods/edit', [plugin\ky_shouyin\app\controller\admin\GoodsController::class, 'edit']); // 编辑商品
    Route::post('/goods/delete', [plugin\ky_shouyin\app\controller\admin\GoodsController::class, 'delete']); // 删除商品
    Route::get('/goods/import', [plugin\ky_shouyin\app\controller\admin\GoodsController::class, 'import']); // 导入商品页面
    Route::post('/goods/import', [plugin\ky_shouyin\app\controller\admin\GoodsController::class, 'import']); // 导入商品
    Route::get('/goods/category', [plugin\ky_shouyin\app\controller\admin\GoodsController::class, 'category']); // 商品分类
    Route::get('/goods/category_list', [plugin\ky_shouyin\app\controller\admin\GoodsController::class, 'categoryList']); // 商品分类
    Route::get('/goods/category_add', [plugin\ky_shouyin\app\controller\admin\GoodsController::class, 'category_add']); // 添加分类页面
    Route::post('/goods/category_add', [plugin\ky_shouyin\app\controller\admin\GoodsController::class, 'category_add']); // 添加分类
    Route::get('/goods/category_edit', [plugin\ky_shouyin\app\controller\admin\GoodsController::class, 'category_edit']); // 编辑分类页面
    Route::post('/goods/category_edit', [plugin\ky_shouyin\app\controller\admin\GoodsController::class, 'category_edit']); // 编辑分类
    Route::post('/goods/category_delete', [plugin\ky_shouyin\app\controller\admin\GoodsController::class, 'category_delete']); // 删除分类

    // 上传图片
    Route::post('/upload/image', [plugin\ky_shouyin\app\controller\admin\UploadController::class, 'image']);

    // 会话检查
    Route::get('/account/checkSession', [plugin\ky_shouyin\app\controller\admin\AccountController::class, 'checkSession']);
});



return [];

